// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from "vue";
import App from "./App";
import router from "./router";
import "lib-flexible";

import { setMetaTitle } from "@/assets/js/common/setMetaTitle.js";
import tool from "@/assets/js/common/tool.js";
import "@/assets/css/common/reset.css";
import "@/assets/css/common/border.css";
import "@/assets/css/common/common.css";
Vue.config.productionTip = false;

Vue.directive("title", {
  inserted: function(el, binding) {
    setMetaTitle(binding.value);
  }
});

router.beforeEach((to, from, next) => {
  window.history.replaceState(null, null, window.location.href);
  next();
});

/* eslint-disable no-new */
new Vue({
  el: "#app",
  router,
  components: { App },
  template: "<App/>"
});
